#delimit ;
set more off;

/*NOTE: For a Mac, file path names use a forward slash (/) but for 
PC's they require a backward slash (\). Make these changes below 
if necessary depending on your computer type. 
*/

*Dropbox paths by user;
if c(username)=="shayaksarkar" {;
	local path "/Users/shayaksarkar/Desktop/ReStat_Data_Publication";
};

/*TABLE 2*/;

cd `path';

use "`path'/dta/final_competition.dta", clear;

*set file to which all putexcel commands will refer;
putexcel set "`path'/out/table2.xls", replace;

** PANEL A QUALITY OF ADVICE;

local i=2;
foreach var in lic agent_home agent_office auditor_home auditor_office other_venue audit_duration onlywhole onlyterm onlyulip anywhole anyterm anyulip {;
sum `var';
putexcel A`i'=(r(mean));
local i=`i'+1;
putexcel A`i'=(r(sd));
local i=`i'+1;
};
	
	count;
	putexcel A30=(r(N));

** PANEL B DISCLOSURE EXPERIMENT;

	clear;
	use "`path'/dta/final_disclosure.dta", clear;
	
	local i=2;
foreach var in lic agent_home agent_office auditor_home auditor_office other_venue audit_duration onlywhole onlyterm onlyulip anywhole anyterm anyulip {;
sum `var';
putexcel C`i'=(r(mean));
local i=`i'+1;
putexcel C`i'=(r(sd));
local i=`i'+1;
};
	
	count;
	putexcel C30=(r(N));


** PANEL C SOPHISTICATION EXPERIMENT;
	
	
	clear;
	
	use "`path'/dta/final_sophistication.dta", clear;
	
	local i=2;
foreach var in lic agent_home agent_office auditor_home auditor_office other_venue audit_duration onlywhole onlyterm onlyulip anywhole anyterm anyulip {;
sum `var';
putexcel E`i'=(r(mean));
local i=`i'+1;
putexcel E`i'=(r(sd));
local i=`i'+1;
};
	
	count;
	putexcel E30=(r(N));
	
	

